<template>
    <el-carousel height="350px" :autoplay="false" indicator-position="none">
      <el-carousel-item v-for="item in newsTopList" :key="item.id" class="one" >
        <!-- <img :src="item.cover" alt="" /> -->
        <img :src="item.cover" alt="" />
        <!-- <div style="color: aqua;background-color: black; display: flex;justify-content: center;line-height: 50px;">{{ item.name }}</div> -->
      </el-carousel-item>
    </el-carousel>

  </template>
  
  <script setup>
  import { postLoadAllTopNews } from "@/api/Home";
  import { onMounted, ref } from "vue";
  let newsTopList = ref([]);
  // 获取所有图 接口
  const loadAllTopNews = async () => {
    const newQueryDto = { isTop: true };
    let load = await postLoadAllTopNews(newQueryDto);
    
    if (load.data.code === 200) {
      newsTopList.value = load.data.data;
      console.log(newsTopList.value,"123321");
    }
    
  };
  
  onMounted(() => {
    loadAllTopNews();
  });
  </script>
  
  <style lang="scss" scoped>
  .one {
  
    img {
      width: 100%;
      height: 300px;
    }
  }
  </style>
  